package com.triones.api.controller.api.interlace;

import cn.dev33.satoken.annotation.SaIgnore;
import com.ruoyi.common.core.controller.BaseController;
import com.triones.api.service.interlace.InterlaceWebhookService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * api - interlace 回调通知
 *
 * @Author: triones
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/interlace/callback")
public class ApiInterlaceWebhookController extends BaseController {

    private final InterlaceWebhookService interlaceWebhookService;

    /**
     * interlace 回调接口
     * @param request
     * @throws Exception
     */
    @SaIgnore
    @RequestMapping("/webhook")
    public Map<String, Boolean> webhook(HttpServletRequest request) throws Exception {
        return interlaceWebhookService.interlaceWebhook(request);
    }
}
